package com.itheima.example.consumer;

import com.itheima.example.common.model.User;
import com.itheima.example.common.service.UserService;
import com.itheima.weirpc.proxy.ServiceProxyFactory;

/**
 * ClassName: ConsumerExampleCache
 * Package: com.itheima.example.consumer
 * Description:
 *
 * @Author 看到风
 * @Create 2024/11/24 21:50
 * @Version 1.0
 */
public class ConsumerExampleCache {
    public static void main(String[] args) {
        for (int i = 0; i < 30; i++) {
            UserService userService = ServiceProxyFactory.getProxy(UserService.class);
            User user = new User();
            user.setName("weihe");
            //调用
            User newUser = userService.getUser(user);

            if(newUser!=null){
                System.out.println(newUser.getName());
            }
            else{
                System.out.println("user == null");
            }
        }
    }
}
